package com.zlyx.easy.core.utils;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.zlyx.easy.core.map.Maps;

public class MapClass {

	public Map<String, Field> clazz = Maps.newMap();

	public void addField(Field field) {
		this.clazz.put(field.getName(), field);
	}

	public Set<String> getFieldNames() {
		return this.clazz.keySet();
	}

	public Field getField(String fieldName) {
		return this.clazz.get(fieldName);
	}

	public boolean haveField(String fieldName) {
		return this.clazz.containsKey(fieldName);
	}

	@Override
	public String toString() {
		return clazz.toString();
	}

	public Map<String, Field> getMap() {
		return clazz;
	}

	public List<Field> getFields() {
		return new ArrayList<Field>(clazz.values());
	}
}